package com.jy.bo.common.conf.util;

import com.fqgj.exception.common.ApplicationException;
import com.fqgj.exception.enums.ErrorCodeEnum;
import com.jy.bo.common.conf.enums.RestCodeEnum;

import javax.validation.constraints.NotNull;

public class ParamsValidateUtil {

    public static void checkParams(boolean checkResult, String resultDesc) {
        if (checkResult) {
            throw new ApplicationException(RestCodeEnum.SYSTEM_PARAMETER_ERROR.setDesc(resultDesc));
        }
    }

    public static void checkParams(boolean checkResult, @NotNull ErrorCodeEnum errorCodeEnum) {
        if (checkResult) {
            throw new ApplicationException(errorCodeEnum);
        }
    }
}
